package com.qf.web;

import com.qf.bean.Dept;
import com.qf.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/*
            敲得越多，钱越多！！！
            敲得越多，钱越多！！！
            敲得越多，钱越多！！！
*/
//此处为查询部门
@Controller
public class DeptController {

    @Autowired
    private DeptService service;
    @RequestMapping("/resource/demo2/getalldepts")
    public String getall(ModelMap map){
        List<Dept> findalldepts = service.findalldepts();
        map.addAttribute("dlist",findalldepts);
        return "resource/demo2/add";
    }
}
